<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
<%@ include file="../common/common.jsp" %>
<%@ include file="user_pass2.jsp" %>
<%
if(!userLogin.withPermission(5001))
{
	HtmlConst.errors(out,1,"您没有当前操作的权限！");
	return;
}			
//权限判断代码结束
ITopicService topicService = (ITopicService)BeanManager.getBean("topicService");
topicService.AutoBindingRecycleTable(request);

%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><%=SYSTITLE%> - 回收站</title>
<meta name="Keywords" content="<%=SYSMETAKEY%>"/>
<meta name="Description" content="<%=SYSMETADESC%>"/>
<%@ include file="../common/meta.inc" %>
<link rel="stylesheet" type="text/css" href="css/defaultStyle.css" >
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/extremetable/new/extremecomponents.css"/>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/common-validator.js"></script>
<script language="javascript" src="${pageContext.request.contextPath}/scripts/prototype.js"></script>
<script language="javascript" src="${pageContext.request.contextPath}/scripts/buffalo/buffalo.js"></script>
</head>
<body>
<%@ include file="../common/waiting.inc" %>
<SCRIPT language="javascript">

setStatus('<%=SYSTITLE%> - 回收站');

var END_POINT="${pageContext.request.contextPath}/buffalo";
var buffalo = new Buffalo(END_POINT);

function doConfirm(objs)
{
	var actionFlag = $F("actionFlag");
	var ids = getCheckBoxValues(objs);
	if(!sl_checkBox(objs,"主题")) return false;	
	
	if(actionFlag==1) //恢复主题
	{		
		if(!sl_confirm("恢复主题")) return false;		
		
		buffalo.remoteCall("topicServiceAjaxService.doResume",[ids], function(reply) {
	        ajaxSubmit(reply.getResult(),"恢复成功！","reload");
	    });
	}
	else if(actionFlag==2)
	{		
		if(!sl_confirm("物理删除主题(删除后的主题将无法恢复)")) return false;		
		
		buffalo.remoteCall("topicServiceAjaxService.delete",[ids], function(reply) {
	        ajaxSubmit(reply.getResult(),"删除成功！","reload");
	    });
	}
}
</SCRIPT>
<script language="javascript" type="text/javascript" src="template/scripts/topBar.js"></script>
<DIV class="line"></DIV>
<DIV class="list_table_0">
<%=HtmlConst.navMenu("topic_recycle.jsp","回收站")%>
&nbsp;&nbsp;[<a href="topic_recycle.jsp?listType=topic">显示所有主题</a>]
&nbsp;&nbsp;[<a href="topic_recycle.jsp?listType=re">显示所有回复</a>]
</DIV>
<DIV class="line"></DIV>
<form name="theform" id="theform" method="post">
	<ec:table 	    	    
		items="resultList"		
		var="rs"	
		retrieveRowsCallback="limit"
        sortRowsCallback="limit"			
		action="${pageContext.request.contextPath}/club/topic_recycle.jsp"	
		>	
		<ec:row>
				<ec:column property="AFF_ID" title="主题" >
					<input type="checkbox" name="topicId" value="${rs.TOPIC_ID}">${rs.TITLE}
				</ec:column>							
				<ec:column property="TOPIC_TYPE_NAME" title="类型"/>	
				<ec:column property="TOPIC_PRO_NAME" title="状态"/>				
				<ec:column property="TOPIC_RE_COUNT" title="回复数" />
				<ec:column property="LOGIN_ID" title="发帖人"/>
				<ec:column property="TOPIC_LAST_RE_TIME" title="最后更新"  cell="date"/>											
		</ec:row>
	</ec:table>
<%//权限判断开始
if(!userLogin.withPermission(5003)){%>
<table width="100%"  border="0" align="center" cellpadding="2" cellspacing="1" class="tab">
<tr class="tab2">
	<td height="25" align="right">
		<input name="selectAll" type="checkbox" id="selectAll" onclick="selectAllBox(document.theform.topicId);"/>全（反）选
		&nbsp;&nbsp;&nbsp; 
		<select name="actionFlag" id="actionFlag">
			<option value="0" selected="selected">选择要操作的内容</option>
			<option value="1">恢复主题</option>
			<option value="2">物理删除主题</option>
		</select>&nbsp;&nbsp;&nbsp; 
		<button accessKey=c id="btnConfirm" name="btnConfirm" class="btn" title="确定" onclick="javascript:doConfirm(document.theform.topicId);">确定(<u>C</u>)</button>
	</td>
</tr>
</table>
<%}%>
</form>
<%@ include file="includes/page_example.inc" %>
<%=COPYRIGHTFOOT%>
<%@ include file="../common/foot.inc"%>
</body>
</html>
